#!/usr/bin/env python
#-*- coding:utf-8 -*-
'''
__author-default__ = 'Pup--->>WX_l599p22'
__cttime-default__ = '20170721'
'''

from flask_script import Manager
from app import app,db
from models import User


manager = Manager(app)

@manager.command
def save():
	# user = User('abc','abc@qq.com')
	# user.save()
	user = User(name='aaa',email='aaa@qq.com')
	user.save()

@manager.command
def query_all():
	# users = User.query_all()
	# for user in users:
	# 	print user
	users = User.objects.all()
	for user in users:
		print user


if __name__=='__main__':
	manager.run()